class Solution:
    def jump(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        L = len(nums)
        if L in [0,1]:
            return 0
        N = nums[0]
        n = N
        result = 1
        for i in range(1,L-1):
            N = max(nums[i]+i,N)
            if i >= n:
                n = N
                result += 1   
            if n>=L-1:
                return result
        return result